package com.zhouqinuan.spring.cloud.develop.framework.demo.consumer.controller;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.UserFeign;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.req.GetUserInfoByIdReq;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.resp.GetUserInfoByIdResp;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "用户模块")
@RestController("/user")
public class UserController {

    @Autowired
    private UserFeign userFeign;
    
    @ApiOperation("根据用户ID获取用户信息")
    @PostMapping("/getUserInfoById")
    public GetUserInfoByIdResp getUserInfoById(@RequestBody @Valid GetUserInfoByIdReq reqVO) throws Exception {
        
        return userFeign.getUserInfoById(reqVO);
    }
}
